<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@page import="test.*"%>

<%@page import="java.sql.*"%>
<%@page import = "java.util.Date" %>
<%@page import = "java.text.DateFormat" %>
<%@page import = "java.text.SimpleDateFormat" %>

<%@page import="java.util.*"%>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel = "stylesheet" type = "text/css" href = "main.css"></link>
<title>Conference Details</title>
</head>
<body>

<div id = "header">
 <div style="float:left">
 <img height="75px" width="165px" alt="IMAGE" src="./Img/banner1.jpg"/>
 <img height="75px" width="165px" alt="IMAGE" src="./Img/banner2.jpg"/>
 <img height="75px" width="165px" alt="IMAGE" src="./Img/banner3.jpg"/>
 <img height="75px" width="160px" alt="IMAGE" src="./Img/banner5.jpg"/>
  <img height="75px" width="160px" alt="IMAGE" src="./Img/banner4.jpg"/>
   <img height="75px" width="162px" alt="IMAGE" src="./Img/banner7.jpg"/> 
 </div>
 
 </div> 
 <div id = "main" > 
 <div id = "main-left"> 
 <div id = "links">
 <a id = "link1" href ="Home.jsp"> Home </a>
 <br/>
 <br/>
 <a id = "link2" href = "viewConferences.jsp"> View Conference</a>
  <br/>
 <br/>
 <a id = "link3" href = "RegisterConference.jsp"> Register for Conference</a>
  <br/>
 <br/>
 <a id = "link4" href = "ListOfAttendees.jsp"> List of Attendees</a>
  <br/>
 <br/>
 <a id = "link5" href = "PresentWorkshop.jsp">Submit Proposal</a>
  <br/>
 <br/>
 <a id = "link6" href = "Admin.jsp">Administrator</a>
 </div>
 </div>
 <div id = "main-right">
  <h1 id = "title" ><em>Tutor/Mentor Leadership And Networking Conference</em> </h1>
 <div class = "myProfile">
 <%
 	
 	String id = request.getParameter("confid");
 	int conferenceId = Integer.parseInt(id);
 	String confName = request.getParameter("confName");
 	String sDate = request.getParameter("startDate");
 	System.out.println("The start Date of this conference is " +sDate);
 	String eDate = request.getParameter("endDate");
 	
 %>
<h4>The following are the details about<em> <%=confName%> </em>including workshops to be conducted and speaker Info</h4>
 <h3>Workshops to be conducted on : <%=sDate %></h3>
<%
	try {
		WorkshopDataAccess1 workshopObj = new WorkshopDataAccess1();
		Workshop w = new Workshop();
		Speaker s = new Speaker();
		List<Workshop> l1 = new ArrayList<Workshop>();
		List<Speaker> l2 = new ArrayList();
		l1 = workshopObj.getWorkshopsForSelectedConference(
				conferenceId, sDate);
		Iterator<Workshop> i = l1.iterator();
		String speakerName;
		while (i.hasNext()) {
			w = i.next();
			String wTitle = w.getWorkshopTitle();
			String description = w.getWorkshopDescr();
			String levelOfExp = w.getLevelOfExperience();
			String startTime = w.getStartTime();
			String endTime = w.getEndTime();
			int speakerId = w.getSpeakerId();
			l2 = workshopObj.getSpeakerInfo(speakerId);
			Iterator<Speaker> i1 = l2.iterator();
%> 
  <table cellpadding="2" cellspacing="2" border =1>
  <tr>
  <th>Title</th>
  <th>Description</th>
  <th>Experience</th>
  <th> Starts</th>
  <th>Ends</th>
  <th>Speaker</th>
  </tr>
  <tr>
  <td>
  <%=wTitle%>
   </td>
  <td>
  <%=description%>
  </td>
  <td>
  <%=levelOfExp%>
  </td>
  <td>
  <%=startTime%>
  </td>
  <td>
  <%=endTime%>
  </td>
  <td>
  <%
  	while (i1.hasNext()) {
  				s = i1.next();
  				String fName = s.getFname();
  				String lName = s.getLname();
  				speakerName = fName + " " + lName;
  %>
	 
  <%=speakerName%><%
	   	}
	   %>
  </td>
  </tr>
  
  </table>
  <br/>
  <br/>
	
	
	<%
				}
				} catch (Exception e) {
					e.printStackTrace();
				}
			%>
			
		<br/>	
			
			 <h3>Workshops to be conducted on : <%=eDate %></h3>
<%
	try {
		WorkshopDataAccess1 workshopObj = new WorkshopDataAccess1();
		Workshop w = new Workshop();
		Speaker s = new Speaker();
		List<Workshop> l1 = new ArrayList<Workshop>();
		List<Speaker> l2 = new ArrayList<Speaker>();
		l1 = workshopObj.getWorkshopsForSelectedConference(
				conferenceId, eDate);
		Iterator<Workshop> i = l1.iterator();
		String speakerName;
		while (i.hasNext()) {
			w = i.next();
			String wTitle = w.getWorkshopTitle();
			String description = w.getWorkshopDescr();
			String levelOfExp = w.getLevelOfExperience();
			String startTime = w.getStartTime();
			String endTime = w.getEndTime();
			int speakerId = w.getSpeakerId();
			l2 = workshopObj.getSpeakerInfo(speakerId);
			Iterator<Speaker> i1 = l2.iterator();
%> 
 
  <table cellpadding="2" cellspacing="2" border =1>
  <tr>
  <th>Title</th>
  <th>Description</th>
  <th>Experience</th>
  <th> Starts</th>
  <th>Ends</th>
  <th>Speaker</th>
  </tr>
  <tr>
  <td>
  <%=wTitle%>
   </td>
  <td>
  <%=description%>
  </td>
  <td>
  <%=levelOfExp%>
  </td>
  <td>
  <%=startTime%>
  </td>
  <td>
  <%=endTime%>
  </td>
  <td>
  <%
  	while (i1.hasNext()) {
  				s = i1.next();
  				String fName = s.getFname();
  				String lName = s.getLname();
  				speakerName = fName + " " + lName;
  %>
	 
  <%=speakerName%><%
	   	}
	   %>
  </td>
  </tr>
  
  </table>
  <br/>
  <br/>
	
	
	<%
				}
				} catch (Exception e) {
					e.printStackTrace();
				}
			%>
 </div>
 </div>
 </div>
</body>
</html>